﻿Imports System.Data
Imports FirebirdSql.Data
Imports FirebirdSql.Data.FirebirdClient
Public Class _motivo
    Inherits _DataBase


    Private _idMotivo As Integer
    Public Property idMotivo() As Integer
        Get
            Return _idMotivo
        End Get
        Set(ByVal value As Integer)
            _idMotivo = value
        End Set
    End Property
    Private _dsMotivo As String
    Public Property dsMotivo() As String
        Get
            Return _dsMotivo
        End Get
        Set(ByVal value As String)
            _dsMotivo = value
        End Set
    End Property


    Public Function consultaMotivo() As DataSet
        conectaDb()
        consultaMotivo = retornaDataSet(montaParametrosSQL("SP_MOTIVO_CONSULTA", "TODOS"))
        desconectaDb()
    End Function

    Private Function montaParametrosSQL(ByVal nomeSP As String, ByVal pModo As String) As FbCommand
        With cmd
            .CommandText = nomeSP
            With .Parameters
                .Clear()
                .Add("MODO", FbDbType.VarChar, 10).Value = pModo
                .Add("I_ID_MOTIVO", FbDbType.Integer).Value = idMotivo
                .Add("I_DS_MOTIVO", FbDbType.VarChar, 50).Value = dsMotivo
            End With
        End With
        Return cmd
    End Function




End Class
